******************************
* Table 3: Table 3: School-level analysis of take-up of DFS 
* col 1, 2, 3
************************
clear all
set trace off
set more off
use "bl_cook_survey.dta"
append using el_cook_survey.dta 
save bl_el_cook_survey, replace

clear
use Jehanabad_analytic_sample_hemoglobin.dta
collapse total_enrollment class_size student_teacher_ratio calories_ph iron_ph treat, by (school_id)
merge 1:m school_id using bl_el_cook_survey
keep if _merge==3

g dfs=( el_psa1_brand_tata==2)
replace wave=0 if wave==.
g treat1=treat
sort school_id wave
replace treat1=treat[_n+1] if wave==0
g block_id=(school_id < 1199)

* col 1 *
areg dfs treat1##wave, r a(school_id) /* no school control is added because the modle includes school fixed effects */
est sto m1

outreg2 using table3.doc, word label replace ctitle(DFS present, in the kitchen)  dec(3) keep(1.treat1#1.wave) ///
addtext(School-level controls, No, School fixed effect, Yes, Block fixed effect, No)  ///
addnote(Notes: Robust standard errors are presented in parentheses. Column 1 reports estimates from the, ///
DID specification while columns 2 and 3 report results from the simple difference model using, the ///
endline data only. School controls include school enrollment class size and student-teacher ratio. *** denote significance at the 1% level.) nocons nor2 ///
title(Table 3: School-level analysis of take-up of DFS) nonotes 


** col 2
g dfs_source=( el_psf2a_source==3)  /* 3 is delivery from project team) */
reg dfs_source treat total_enrollment class_size student_teacher_ratio if wave==1, r  a(block_id)
est sto m2
outreg2 using table3.doc, append ctitle(Salt delivered by, the project team) dec(3) keep(treat) addtext(School-level /// 
controls, Yes, School fixed effect, No, Block fixed effect, Yes) nocons nor2 label


** col 3
clear
use Jehanabad_analytic_sample_hemoglobin.dta
collapse total_enrollment class_size student_teacher_ratio calories_ph iron_ph treat, by (school_id)
merge 1:m school_id using "Headmaster_School_id_Round2_joint_clean.dta" 
g block_id=(school_id < 1199)
g change_food_color=(hmm19r_change==1)
*g treat=II4a_treatment
areg  change_food_color treat total_enrollment class_size student_teacher_ratio, r a(block_id)
est sto m3
outreg2 using table3.doc, append ctitle(Change in, food color) dec(3) keep(treat) addtext(School-level controls, Yes, /// 
School fixed effect, No, Block fixed effect, Yes) nocons nor2

********************************************End of do file *******************


